home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Wayzata's Best of Shareware PC/Windows 1
/
Wayzata's Best of Shareware for PC-Windows - Release 1 - Wayzata Technology (1993).iso
/
mac
/
ZIPPED
/
WINDOWS
/
TELECOMM
/
CCDIAL10.ZIP
/
CCDIALER.WAS
next >
Wrap
Text File
|
1992-10-22
|
17KB
|
301 lines
;CCDIALER.WAS - 1.00 Credit Card Dialer
;****************************************************************************
;* *
;* CCDIALER.WAS *
;* Copyright (C) 1992 Datastorm Technologies, Inc *
;* *
;* Purpose: To Automate the dialing of long distance credit card *
;* numbers. This script will make it easier to use the *
;* dialing directory without the need to set up long distance *
;* codes. *
;* *
;* Program Flow: Enter Credit Card Information *
;* Create the Dialing Directory List *
;* Have User Choose the entry to dial *
;* Transmit the Long Distance Service Number *
;* Wait the specified Service Wait *
;* Transmit the Telephone Number *
;* Wait the specifiec Pre-Card Wait *
;* Transmit the Credit Card Number *
;* Wait for a Connection *
;* Execute the Diling Directory Script - If any *
;* *
;* This ASPECT SCRIPT is intended only as a sample of ASPECT programming. *
;* DATASTORM makes no warranty of any kind, express or implied, including *
;* without limitation, any warranties of merchantability and/or fitness *
;* for a particular purpose. Use of this program is at your own risk. *
;* *
;* Author: Kevin Bailey *
;****************************************************************************
;****************************************************************************
;* MACRO DEFINITIONS *
;****************************************************************************
#define ATDT "ATDT" ;Shorthand for commonly used string
#define GLUE ";^M" ;Shorthand.........
#define ENTER "^M" ;Shorthand.........
;****************************************************************************
;* GLOBAL VARIABLES *
;****************************************************************************
string modinit ;Modem Init string
string initfile="CCDIALER.INI" ;Init file name
string dirfile="ccdialer.dir" ;Temporary Dialing Directory file
string ServiceNum ;Service Number
string CardNum ;Credit Card Number
string TempWait1="10" ;Pre-set wait after dialing service
string TempWait2="5" ;Pre-set wait before dialing Card
string dchoice ;Dialing directory choice
integer ServiceWait ;Wait after dialing service number
integer PreCardWait ;Wait before dialing credit card
integer stat ;Status flag
integer dialndx ;Index number of dialing entry
;****************************************************************************
;* *
;* MAIN *
;* The main procedure calls all set up procedures and does the dialing of *
;* the service, telephone and credit card numbers. *
;* *
;* Calls: setfile, getddir, choose, nomodem, cleanup *
;* Modifies Globals: dialndx *
;****************************************************************************
proc main
when userexit call cleanup ;Trap user exits events
setfile() ;Initialize variables
getddir() ;Initialize directory list
choose() ;Choose entry to dial
if stat == 1 ;If CANCEL is chosen,
cleanup() ;exit CCDIALER.WAS
endif
dialfind dchoice dialndx ;Find the dialing entry
set dialdir access dialndx ;Set access
fetch modem init modinit ;Save the init string
transmit "^M^M^M" ;Clear the modem
pause 1 ;Allow the modem to settle
clear ;Clear the screen
transmit "ATX1M1^M" ;Blind the modem, reduce CD wait.
pause 1
transmit "ATS7=127^M" ;Boost wait time for carrier.
pause 1
statmsg "Dialing the Service Number: %s" ServiceNum
transmit ATDT ;
transmit ServiceNum ;Dial the ServiceNum.
transmit Glue ;
waitfor "OK" 5 ;Wait for an affirmative response.
if failure ;If the modem did not respond,
nomodem() ;then bail-out.
endif
pause ServiceWait ;Wait for the second tone.
statmsg "Dialing Telephone Number: %s" $D_NUMBER
transmit ATDT ;
transmit $D_NUMBER ;Dial the phone number
transmit Glue ;from the dialing dir.
waitfor "OK" 5 ;Wait for an affirmative response.
if failure ;If the modem did not respond,
nomodem() ;then bail-out.
endif
pause PreCardWait ;Wait for the third tone
statmsg "Dialing credit card information."
transmit ATDT ;
transmit CardNum ;Dial the credit card number.
transmit ENTER ;
clear ;Clear the screen.
statmsg "Waiting for carrier." ;Keep the user informed.
waitfor "CONNECT" 40 ;Wait for the CONNECT
if success ;message from modem.
if $CARRIER ;Make sure CARRIER is high
execute $D_SCRIPT ;Execute Directory Script
endif
endif
cleanup() ;Finished.
endproc ;
;****************************************************************************
;* *
;* NOMODEM *
;* This modem reports an error back to the user that the modem has not *
;* responded to the commands sent. *
;* *
;* Calls: N/A *
;* Called By: MAIN *
;* Modifies Globals: N/A *
;****************************************************************************
proc nomodem
usermsg "Modem did not respond. Try increasing transmit pacing."
transmit "^M^M" ;Clear the modem and attempt to
transmit modinit ;reset modem to default settings.
cleanup() ;Back to the terminal
endproc
;****************************************************************************
;* *
;* SETFILE *
;* This procedure maintains the CCDIALER.INI file which contains the *
;* service and credit card numbers to use while dialing. *
;* *
;* Calls: NUMINIT *
;* Called By: MAIN *
;* Modifies Globals: ServiceNum, CardNum, TempWait1, TempWait2, *
;* ServiceWait, PreCardWait *
;****************************************************************************
proc setfile
fopen 0 initfile READWRITE TEXT ;Open the init file
if success ;File exists
fgets 0 ServiceNum ;Read in the service number
fgets 0 CardNum ;Read in the credit card
fgets 0 TempWait1 ;Read in the service wait
fgets 0 TempWait2 ;Read in the credit card wait
fclose 0 ;Close the init file
atoi TempWait1 ServiceWait ;Convert to an integer
atoi TempWait2 PreCardWait ;Convert to an integer
endif
statmsg "Parameter Setup"
numinit() ;Display the setup dialog
endproc
;****************************************************************************
;* *
;* NUMINIT *
;* Displays the dialog box with the current settings and allows the user *
;* to modify them before continuing. *
;* *
;* Calls: N/A *
;* Called By: SETFILE *
;* Modifies Globals: ServiceNum, CardNum, TempWait1, TempWait2, *
;* ServiceWait, PreCardWait *
;****************************************************************************
proc numinit
dialogbox 88 57 196 146 3 "Credit Card Dialer Setup"
text 6 6 184 8 left "Service Number to Dial:"
editbox 5 14 182 13 ServiceNum 40
text 6 36 174 8 left "Credit Card Number:"
editbox 5 44 181 13 CardNum 40
text 6 70 112 8 left "Pause AFTER Service Number:"
editbox 121 67 32 12 TempWait1 3
text 154 70 34 8 left "seconds"
text 6 86 110 8 left "Pause BEFORE Card Number:"
editbox 121 84 32 12 TempWait2 3
text 154 86 32 8 left "seconds"
pushbutton 41 115 40 14 "Cont" normal
pushbutton 110 115 40 14 "Quit" cancel
enddialog
updatedlg -1 ;Display the dialog
while 1 ;Loop until Cont or Quit
switch $dialog
case 230 ;ServiceNum Edit Box
updatedlg 8
endcase
case 231 ;CardNum Edit Box
updatedlg 9
endcase
case 232 ;ServiceWait Edit Box
updatedlg 10
endcase
case 233 ;PreCardWait Edit Box
updatedlg 11
endcase
case 1 ;Quit button selected
cleanup() ;Exit CCDIALER.WAS
endcase
case 10 ;Cont button selected
exitwhile ;Exit the while loop
endcase
endswitch
endwhile
atoi TempWait1 ServiceWait ;Convert to integer
atoi TempWait2 PreCardWait ;Convert to integer
fopen 0 initfile CREATE TEXT ;Open the init file
fputs 0 ServiceNum ;Write ServiceNum
fputs 0 CardNum ;Write CardNum
fputs 0 TempWait1 ;Write ServiceWait
fputs 0 TempWait2 ;Write PreCardWait
fclose 0 ;Close init file
endproc
;****************************************************************************
;* *
;* GETDDIR *
;* This procedure saves the dialing directory entry names to a temporary *
;* file on disk to be displayed to the user during the CHOOSE procedure. *
;* *
;* Calls: N/A *
;* Called By: MAIN *
;* Modifies Globals: N/A *
;****************************************************************************
proc getddir
;****************************************************************************
;* LOCAL VARIABLES *
;****************************************************************************
integer ent=1 ;Count variable
fopen 1 dirfile CREATE TEXT ;Open the temporary file
while ent <= $DIALCOUNT ;Loop until all entries processed
set dialdir access ent ;Set current directory entry
fputs 1 $D_NAME ;Write the entry name
ent = ent + 1 ;Increment counter
endwhile
fclose 1 ;Close the file
endproc
;****************************************************************************
;* *
;* CHOOSE *
;* The procedure choose provides the user with a list of entries which *
;* may be dialed, from which he/she may select one or more. *
;* *
;* Calls: N/A *
;* Called by: MAIN *
;* Modifies globals: stat *
;* *
;****************************************************************************
proc choose
dialogbox 25 10 193 98 3 "Credit Card Dialing Selection"
text 1 3 77 8 center "Name"
flistbox 5 17 181 61 dirfile single dchoice
pushbutton 53 75 40 14 "OK" normal default
pushbutton 113 75 40 14 "Cancel" cancel
enddialog
stat=$DIALOG ;Save the DIALOG status
while stat != 10 && stat != 1 ;Loop until OK or CANCEL
stat=$DIALOG ;Save the DIALOG status
endwhile
endproc
;****************************************************************************
;* *
;* CLEANUP *
;* This procedure closes and deletes all temporary files used. *
;* *
;* Calls: N/A *
;* Called By: MAIN, NUMINIT, NOMODEM *
;* Modifies Globals: N/A *
;****************************************************************************
proc cleanup
statmsg "Exiting CCDIALER." ;Notify User
isfile dirfile ;Check for file
if success
delfile dirfile ;Delete file
endif
exit ;Exit CCDIALER.WAS
endproc